package com.yuanfeng.commoms.util;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class PasswordUtils {

    /**
     * BCryptPasswordEncoder加密
     */
    public static String BCryptPasswordEncoder(String str) {
        String password=null;
        BCryptPasswordEncoder b=new BCryptPasswordEncoder();
        password=b.encode(str);
        return password;
    }

    /**
     * BCryptPasswordEncoder比较
     */
    public static Boolean BCryptPasswordMatches(String str1, String str2) {
        BCryptPasswordEncoder b = new BCryptPasswordEncoder();
        Boolean flag = b.matches(str1, str2);
        return flag;
    }
}
